<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>编辑时间-会员</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/font.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/xadmin.css">
    <link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/Swiper/3.4.2/css/swiper.min.css">
    <script type="text/javascript" src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
    <script type="text/javascript" src="https://cdn.bootcdn.net/ajax/libs/Swiper/3.4.2/js/swiper.jquery.min.js"></script>
    <script src="${pageContext.request.contextPath}/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/xadmin.js"></script>
</head>
<body>
<!-- 中部开始 -->
<div class="wrapper">
    <!-- 右侧主体开始 -->
    <div class="page-content">
        <div class="content">
            <!-- 右侧内容框架，更改从这里开始 -->
            <form class="layui-form" action="" method="">
                <input type="text" hidden name="reserveid" value="${reserve.reserveid}">
                <div class="layui-form-item">
                    <label for="L_1" class="layui-form-label">
                        选择时间
                    </label>
                    <div class="layui-input-inline">
                        <input type="date" id="L_1" name="date" required lay-verify="date"
                               autocomplete="off" class="layui-input" >
                    </div>
                    <div class="layui-form-mid layui-word-aux">
                        与教练商定的日期
                    </div>
                </div>
                <div class="layui-form-item">
                    <label for="L_1" class="layui-form-label">
                    </label>
                    <button type="button" class="layui-btn" key="set-mine" lay-filter="save" lay-submit id="save">
                        确定
                    </button>
                </div>
            </form>
        </div>
            <!-- 右侧内容框架，更改从这里结束 -->
    </div>
    <!-- 右侧主体结束 -->
</div>
<!-- 中部结束 -->
<script>
    $("#save").click(function (){
        console.log($("input[name='date']").val());
        $.ajax({
            url:"${pageContext.request.contextPath}/member/changeDates.action",
            type:"post",
            dataType:"text",
            data: {
                reserveid:$("input[name='reserveid']").val(),
                reservedate:$("input[name='date']").val(),
            },
            success:function (date){
                if ("ok"==date){
                    // console.log(date);
                    //关闭修改页面弹框
                    x_admin_close();
                    //刷新页面，重置session内容
                    window.top.location.href="${pageContext.request.contextPath}/member/toOneselfpage.action";
                }else{
                    alert("修改失败！");
                }
            }
        });
    });
</script>
</body>
</html>
